//FYI: https://github.com/Tencent/puerts/blob/master/doc/unity/manual.md

import { FairyEditor} from 'csharp';
import Utils from './Utils';


let menu:FairyEditor.Component.IMenu=FairyEditor.App.menu.GetSubMenu("tool");
FairyEditor.App.add_onProjectOpened(()=>{
  if (menu != null) {
    menu.AddSeperator();
    menu.AddItem(
      "检查命名规范",
      "CheckComName",
      function (str): void {
        FairyEditor.App.consoleView.Clear();
        Utils.findAllPackagesComName();
        console.log("命名查找结束");
      }
    );
  } else {
    console.error("找不到菜单！！！");
  }
});


FairyEditor.App.add_onProjectClosed(() => {
  if (menu != null) {
    menu.RemoveItem("CheckComName");
  }
});


